﻿using Iworld.Author.Manager;
using Iworld.Main.Impl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Iworld.basis.Service
{
    /// <summary>
    /// 检查是否有此用户
    /// </summary>
    [DataContract]
    public class CheckAuthorImportBase : ImportBase
    {
        /// <summary>
        /// 自身
        /// </summary>
        public Iworld.Author.Model.Author Self { get; set; }

        /// <summary>
        /// 自身的ID
        /// </summary>
        public int UserId { set { } get { return this.Self.Id; } }

        /// <summary>
        /// 判定当前用户是否允许执行操作
        /// </summary>
        /// <param name="db">数据库连接对象</param>
        public override void CheckAllowExecuteOrNot(ModelToDbContext db)
        {
            this.Self = AuthorLoginInfoPond.GetUserInfo(db, this.Token);
        }
    }
}
